<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>18-promise异常穿透</title>
</head>
<body>
    <script>
        let P1 = new Promise((resolve, reject) => {
            resolve("ok")
        });
        P1.then(value => {
            console.log(111)
        }).then(value => {
            console.log(222)
            /*返回一个状态为pending的promise对象
            *promise的状态为pending时后面的回调将不会执行
            */
            return new Promise( () => {})
        }).then(value => {
            console.log(333)
        }).catch(reason => {
            console.warn(reason)
        })
    </script>
</body>
</html>